package cn.ac.sec.liquid.monitor_data;

import cn.ac.sec.liquid.common.model.DevData;
import cn.ac.sec.liquid.common.model.OilwellData;

import com.jfinal.core.Controller;

public class MonitorDataController extends Controller {
	
	/**
	 * 从数据库primary_data表中获取一条测量数据(滤波后的波形数据)
	 */
	public void index() {
		
		setAttr("welldataList", OilwellData.dao.find("select * from oilwell_data where dev_id= '00000000000000001' "));
		String xData = DevData.dao.find("select xAxis from dev_data where dev_id= '00000000000000001' ").get(0).toString().split("[:]")[1].split("[}]")[0];
		String yData = DevData.dao.find("select yAxis from dev_data where dev_id= '00000000000000001' ").get(0).toString().split("[:]")[1].split("[}]")[0];
		
		String[] x = xData.split("[,]");
		String[] y = yData.split("[,]");
		
		setAttr("x",x);
		setAttr("y",y);
		render("monitor_data.html");
	}
	
}
